//
//  AtomicSpread.h
//  SujetObserver
//
//  Created by Pierre DUCHENE on 14/02/10.
//  Copyright 2010 Pierre DUCHENE. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseSpread.h"
#import "SensorData.h"


/*!
    @class       AtomicSpread 
    @superclass  NSObject <SpreadProtocol>
    @abstract    This class is a strategy to update displayer atomiquely
    @discussion  The aim is to each displayer see the same information in right order and
				 without loose value.
				 To perform that, it use to diffent queue, one for operation will set the newValue for sensor
				 and another to update displayer.
				 To make atomicity, the strategy builds dependencies between operations:
				 each update operation is dependent of the new value setter operation.
				 And if it still remain operation in update queue, the next new value setter operation
				 is dependent of all remain update operation.
*/
@interface AtomicSpread : BaseSpread {
	
	SensorData* savedData;
	
	NSOperationQueue* queueForSetValue;
	NSOperation* newValueOperation;
	NSMutableArray* lastDependencies;
}

@end
